package au.edu.swin.videoshop.bean;


public class Staff extends Person{
	private Long mStaffId;
	private Staff mSupervisor;
	private StaffRole mRole;
	private Store mStore;
	private StaffSession mCurrentSession;
	
	public Staff() {
	}

	/**
	 * @return the staffId
	 */
	public Long getStaffId() {
		return mStaffId;
	}

	/**
	 * @param staffId the staffId to set
	 */
	public void setStaffId(Long staffId) {
		mStaffId = staffId;
	}

	/**
	 * @return the staffId
	 */
	public Long getId() {
		return mStaffId;
	}

	/**
	 * @return the store
	 */
	public Store getStore() {
		return mStore;
	}

	/**
	 * @param store the store to set
	 */
	public void setStore(Store store) {
		mStore = store;
	}

	/**
	 * @return the currentSession
	 */
	public StaffSession getCurrentSession() {
		return mCurrentSession;
	}

	/**
	 * @param currentSession the currentSession to set
	 */
	public void setCurrentSession(StaffSession currentSession) {
		mCurrentSession = currentSession;
	}

	public boolean isManager() {
		return (mRole == StaffRole.STORE_MANAGER || mRole == StaffRole.SENIOR_MANAGER);
	}
	
	public boolean isSeniorManager() {
		return mRole == StaffRole.SENIOR_MANAGER;
	}

	/**
	 * @return the supervisor
	 */
	public Staff getSupervisor() {
		return mSupervisor;
	}

	/**
	 * @param supervisor the supervisor to set
	 */
	public void setSupervisor(Staff supervisor) {
		mSupervisor = supervisor;
	}

	/**
	 * @return the role
	 */
	public StaffRole getRole() {
		return mRole;
	}

	/**
	 * @param role the role to set
	 */
	public void setRole(StaffRole role) {
		mRole = role;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj instanceof Staff) {
			return this.mStaffId.equals(((Staff)obj).mStaffId);
		}
		return false;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return mStaffId.hashCode();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return mStaffId.toString();
	}
	
}

